<?php
namespace App\Modules\Sms;
use App\Modules\AdapterApi;
use App\Services\Sms\SmsIndex;
/**
 * Created by PhpStorm.
 * User: 97606
 * Date: 2018/6/12
 * Time: 10:10
 */
class Sms extends AdapterApi
{
    /*添加一个短信配置模板（模板+apikey等）*/
    public function addSms(): array 
    {
        $data = pick_array($this->postData, ['app_id','other_app_read','is_public','action','description','sms_info']);
        return SmsIndex::Sms()->addSms($data);
    }

    /*编辑某个短信配置*/
    public function editSms(): array 
    {
        $data = pick_array($this->postData, ['app_id','id','other_app_read','is_public','action','description','sms_info']);
        return SmsIndex::Sms()->editSms($data);
    }


    /*获取短信模板配置列表*/
    public function smsList(): array 
    {
        $data = pick_array($this->postData, ['app_id','page','listRows']);
        return SmsIndex::Sms()->smsList($data);
    }

    /*获取某个短信配置详情*/
    public function smsInfo(): array 
    {
        $data = pick_array($this->postData, ['id','action','app_id']);
        return SmsIndex::Sms()->smsInfo($data);
    }

    /*删除某短信配置*/
    public function delOneSms(): array 
    {
        $data = pick_array($this->postData, ['id','app_id']);
        return SmsIndex::Sms()->delOneSms($data);
    }

    /*发送短信的日志列表*/
    public function logList(): array 
    {
        $data = pick_array($this->postData, ['page','listRows','status','keywords']);
        return SmsIndex::SmsLog()->logList($data);
    }

    


}